#ifndef __TEST_LOCAL_PLANNER_H_
#define __TEST_LOCAL_PLANNER_H_

#include <ros/ros.h>
#include "../core/core.h"
#include "../path_planner/local_planner/local_planner_base.h"
#include "../path_planner/local_planner/dwa/dwa.h"

class LocalPlanner{
    // 定义路径规划函数指针
    // void(LocalPlannerBase::*PlannerPtr)() const;

    public:
        LocalPlanner(tf2_ros::Buffer* tf_buffer);
        ~LocalPlanner();

        // 发布LidarScan2D
        void PublishLidarScan2D(LidarScan2D lidar_scan_2d);

        // Rviz位姿回调函数
        void RvizPosesCallback(const geometry_msgs::PoseStampedConstPtr& msg);
        // 激光雷达回调函数
        void LaserScanCallback(const sensor_msgs::LaserScanConstPtr& msg);
    private:
        ros::NodeHandle __nh;
        ros::Subscriber __rviz_pose_sub;
        ros::Subscriber __scan_sub;
        ros::Publisher __goal_pose_pub;
        ros::Publisher __base_scan_pub;

    private:
        LocalPlannerType __local_planner_type;    //规划器类型
        // Map2D __map_2d;      
        boost::shared_ptr<LocalPlannerBase> __planner_ptr;
        boost::shared_ptr<const geometry_msgs::PoseStamped> __goal_pose_ptr;
        boost::shared_ptr<const sensor_msgs::LaserScan> __scan_ptr;
        
};

#endif